<extend name="./Application/Admin/View/Public/base.html" />
<block name="eosi-css">
    <link href="__PUBLIC__/assets/css/daterangepicker.css" rel="stylesheet">
    <link href="__PUBLIC__/assets/css/rili.css" rel="stylesheet">

</block>
<block name="eosi-js"> 
    <script src="__PUBLIC__/assets/js/date-time/bootstrap-datepicker.min.js"></script>
    <script src="__PUBLIC__/assets/js/jqGrid/jquery.jqGrid.min.js"></script>
    <script src="__PUBLIC__/assets/js/jqGrid/i18n/grid.locale-en.js"></script>
    <script src="__PUBLIC__/assets/js/jqGrid/laydate.dev.js"></script>

    <script type="text/javascript">
        var $path_base = "/"; //this will be used in gritter alerts containing images
    </script>

</block>
<block name="page-content">
    <div class="row">
        <div class="col-xs-12">
            <div style="padding-bottom:5px;">
                <div  id="city_2" style="padding-bottom:5px;">
                <!-- 手机号：<input id="mobile" name="mobile" placeholder="请输入手机号" value="{$mobile}"/> -->
                <!-- 姓名：<input id="create_name" placeholder="姓名" name="create_name" value="{$create_name}" size="39"/> -->
                昵称：<input id="nick_name" placeholder="输入全部或部分昵称查找用户" name="nick_name" value="{$nick_name}" size="39"/><br/>
                <div  style="margin-top: 10px">
                        <span class="input-icon"> 
                    最后访问日期：<input type="text" id="J-xl"  placeholder="选择开始日期"  value="{$firtime}">
                    </span>
                    <span class="input-icon"> 
                        <input type="text" id="J-xl-jie"  placeholder="选择结束日期"  value="{$sectime}">
                    </span> 
                    <span class="input-icon"> 
                    首次访问日期<input type="text" id="J-start"  placeholder="选择开始日期"  value="{$newstart}">
                    </span>
                    <span class="input-icon"> 
                        <input type="text" id="J-end"  placeholder="选择结束日期"  value="{$newend}">
                    </span> 
                    <input type="button" id="search" value="查询"/>
                    &nbsp<input type="button" id="searc" value="导出"> 
                    <input type="button" id="resetBt" value="重置筛选条件" />
                </div>
        </div>
            </div>

            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <th>ID</th>
                        <!-- <th>微信用户openid</th> -->
                        <th>昵称</th>
                        <th>性别</th>
                        <th>省份</th>
                        <th>城市</th>
                        <th>头像</th>
                        <!-- <th>姓名</th>
                        <th>手机</th>
                        <th>地址</th>
                        <th>分值</th>
                        <th>答案</th> -->
                        <th>首次访问时间</th>
                        <th>最后访问时间</th>
                    </tr>
                </thead>
                <tbody>
                <volist name="list" id="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <!-- <td>{$vo.openid}</td> -->
                        <td>{$vo.nickname}</td>
                        <td>
                            <if condition="$vo['sex'] == 1"> 男
                                <elseif condition="$vo['sex'] eq 2"/>女
                                <else /> 未知
                            </if>
                        </td>
                        <td>{$vo.province}</td>
                        <td>{$vo.city}</td>
                        <td><img  height="100px" src="{$vo.headimgurl}"/></td>
                        <!-- <td>{$vo.realname}</td>
                        <td>
                            <if condition="$vo['phone'] == 0"> 
                                <else /> {$vo.phone}
                            </if>
                        </td>
                        <td>{$vo.address}</td>
                        <td>{$vo.score}</td>
                        <td>{$vo.options}</td> -->
                        <td>
                            <if condition="$vo.create_time == 0"> 
                                <else /> {$vo.create_time|date="Y-m-d H:i:s",###}
                            </if>
                        </td>
                        <th>
                            <if condition="$vo['update_time'] == 0"> 
                                <else /> {$vo['update_time']|date="Y-m-d H:i:s",###}
                            </if>
                        </th>
                    </tr>
                </volist>
                </tbody>
            </table>
            <div class="pager">{$page}</div>
        </div>
    </div><!-- /.row -->
    <script type="text/javascript">
        $("#search").click(function(){
            var paras=m_getParas();
           console.log(paras);
            location.href = "/Admin/MemberInfo/index"+paras;

        });
        // 重置
        $("#resetBt").click(function(){
            location.href = "/Admin/MemberInfo/index";
        });
        //导出
        $('#searc').click(function(){
           var paras=m_getParas();
            location.href = "/Admin/MemberInfo/daochu"+paras;
        })
        //  日期控件
        laydate({
                elem: '#J-xl'
            });
        laydate({
                elem: '#J-xl-jie'
            });
        laydate({
                elem: '#J-start'
            });
        laydate({
                elem: '#J-end'
            });
        function m_getParas(){
            var mobile='';
            var create_name='';
            var nick_name='';
            var firtime ="";
            var sectime ="";
            var newstart ='';
            var newend ='';
            // mobile=$('#mobile').val();
            // create_name=$('#create_name').val();
            // if(mobile !=''){
            //     mobile="/mobile/"+mobile;
            // }
            // if(create_name !=''){
            //     create_name="/create_name/"+create_name;
            // }
            nick_name=$('#nick_name').val();
            firtime = $('#J-xl').val();
            sectime = $('#J-xl-jie').val();
            newstart = $('#J-start').val();
            newend = $('#J-end').val();

            if(!g_isEmpty(nick_name)){
                nick_name="/nick_name/"+nick_name;
            }
            if(!g_isEmpty(firtime)){
                firtime="/firtime/"+firtime;
            }
            if(!g_isEmpty(sectime)){
                sectime="/sectime/"+sectime;
            }
            if(!g_isEmpty(newstart)){
                newstart="/newstart/"+newstart;
            }
            if(!g_isEmpty(newend)){
                newend="/newend/"+newend;
            }
            return mobile+create_name+nick_name+firtime+sectime+newstart+newend;
        }
    </script>
</block>